{% extends 'base.html' %}
{% load buttons %}
{% load custom_links %}
{% load helpers %}
{% load plugins %}

{% block header %}
    <div class="row noprint">
        <div class="col-md-12">
            <ol class="breadcrumb">
                <li><a href="{% url 'dcim:cable_list' %}">Cables</a></li>
                <li>{{ object }}</li>
            </ol>
        </div>
    </div>
    <div class="pull-right noprint">
        {% plugin_buttons object %}
        {% if perms.dcim.change_cable %}
            {% edit_button object %}
        {% endif %}
        {% if perms.dcim.delete_cable %}
            {% delete_button object %}
        {% endif %}
    </div>
    <h1>{% block title %}Cable {{ object }}{% endblock %}</h1>
    {% include 'inc/created_updated.html' %}
    <div class="pull-right noprint">
        {% custom_links object %}
    </div>
    <ul class="nav nav-tabs">
        <li role="presentation"{% if not active_tab %} class="active"{% endif %}>
            <a href="{{ object.get_absolute_url }}">Cable</a>
        </li>
        {% if perms.extras.view_objectchange %}
            <li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}>
                <a href="{% url 'dcim:cable_changelog' pk=object.pk %}">Change Log</a>
            </li>
        {% endif %}
    </ul>
{% endblock %}

{% block content %}
    <div class="row">
        <div class="col-md-6">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <strong>Cable</strong>
                </div>
                <table class="table table-hover panel-body attr-table">
                    <tr>
                        <td>Type</td>
                        <td>{{ object.get_type_display|placeholder }}</td>
                    </tr>
                    <tr>
                        <td>Status</td>
                        <td>
                            <span class="label label-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
                        </td>
                    </tr>
                    <tr>
                        <td>Label</td>
                        <td>{{ object.label|placeholder }}</td>
                    </tr>
                    <tr>
                        <td>Color</td>
                        <td>
                            {% if object.color %}
                                <span class="label color-block" style="background-color: #{{ object.color }}">&nbsp;</span>
                            {% else %}
                                <span class="text-muted">&mdash;</span>
                            {% endif %}
                        </td>
                    </tr>
                    <tr>
                        <td>Length</td>
                        <td>
                            {% if object.length %}
                                {{ object.length }} {{ object.get_length_unit_display }}
                            {% else %}
                                <span class="text-muted">&mdash;</span>
                            {% endif %}
                        </td>
                    </tr>
                </table>
            </div>
            {% include 'inc/custom_fields_panel.html' %}
            {% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='dcim:cable_list' %}
            {% plugin_left_page object %}
        </div>
        <div class="col-md-6">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <strong>Termination A</strong>
                </div>
                {% include 'dcim/inc/cable_termination.html' with termination=object.termination_a %}
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <strong>Termination B</strong>
                </div>
                {% include 'dcim/inc/cable_termination.html' with termination=object.termination_b %}
            </div>
            {% plugin_right_page object %}
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            {% plugin_full_width_page object %}
        </div>
    </div>
{% endblock %}
